//
//  LSZleagueTableManager.m
//  JKFuYinProject
//
//  Created by 九酷 on 2017/9/20.
//  Copyright © 2017年 LC. All rights reserved.
//

#import "LSZleagueTableManager.h"
#import "JKSongsMessStatus.h"
#import "LCPlaylist.h"
#import "NetworkTool+LCAVPlay.h"
@interface LSZleagueTableManager ()

@end

@implementation LSZleagueTableManager

-(id)initWithleagueTableManager:(NSDictionary *)dic page:(NSString *)page
{
    self = [super init];
    if (self) {
        self.mutDataArray = [[NSMutableArray alloc]init];
        self.historyArrayData = [[NSMutableArray alloc]init];

        if ([[dic valueForKey:@"data"] isKindOfClass:[NSString class]]) {
            return self;
        }
        if ([[dic valueForKey:@"data"] isKindOfClass:[NSNumber class]]) {
            return self;
        }
        if (![dic valueForKey:@"data"]) {
            return self;
        }
        NSArray * arrayData = dic[@"data"];
        NSMutableArray * mutArrayData= [[NSMutableArray alloc]init];
        
        for (NSDictionary *diction in arrayData) {
            LSZleagueTableMg * tableMg = [[LSZleagueTableMg alloc]init];
            tableMg.album = [NSString stringWithFormat:@"%@",diction[@"album"]];
            tableMg.duration = [NSString stringWithFormat:@"%@",diction[@"duration"]];
            tableMg.fileUrl = [NSString stringWithFormat:@"%@",diction[@"fileUrl"]];
            tableMg.id_id = [NSString stringWithFormat:@"%@",diction[@"id"]];
            tableMg.image = [NSString stringWithFormat:@"%@",diction[@"image"]];
            tableMg.image300 = [NSString stringWithFormat:@"%@",diction[@"image300"]];
            tableMg.n = [NSString stringWithFormat:@"%@",diction[@"n"]];
            tableMg.parentId = [NSString stringWithFormat:@"%@",diction[@"parentId"]];
            tableMg.singerName = [NSString stringWithFormat:@"%@",diction[@"singerName"]];
            tableMg.title = [NSString stringWithFormat:@"%@",diction[@"title"]];
            if([[diction allKeys] containsObject:@"shareUrl"]){
                tableMg.fileUrl    = NullStringjudgment(NSStr(diction[@"shareUrl"]));
            }
            if([[diction allKeys] containsObject:@"click"]){
                tableMg.click    = NullStringjudgment(NSStr(diction[@"click"]));
                tableMg.clickConversion = [LSZSpecialPackaging theNumberViewsForTheAlbumAhanges:tableMg.click];
            }
            [mutArrayData addObject:tableMg];
        }
        self.mutDataArray  = mutArrayData;
        [self.historyArrayData setArray:arrayData]; 
    }
    return self;
}
 
@end
@implementation LSZleagueTableMg

@end
